/*****************************************************************
/     filename:   hw8.l
/
/  description:   Implements a parser for logical expressions
/
/       author:   Szechy, Jared
/     login id:   cps444-n1.10
/
/        class:   CPS 444
/   instructor:   Perugini
/   assignment:   Homework #8
/
/     assigned:   December 2, 2009
/          due:   December 14, 2009
/
/***************************************************************/
%{
#include <string.h>
#include "hw8.tab.h"
extern char* temp;
%}

%%

[()&|~]     { strcat(temp,yytext); return *yytext; }

[t]	      { strcat(temp,yytext); yylval = -1; return BOOL; }

[f]	      { strcat(temp,yytext); yylval = 0; return BOOL; }

\n          { return *yytext; } 

[ \t] ;     { strcat(temp,yytext); }

.           { yyerror ("invalid character"); }

%%

int yywrap (void) { 
   return 1;
}
